Skip to content

feat(pm-console): ask GitHub by tag, keep to its time, and say why a list is old (#13489) - #13570

Merged
dezren39 merged 6 commits into
mainfrom
claude/pm-etags
Nov 23, 2026
Merged

dezren39 merged 6 commits into
mainfrom
claude/pm-etags

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

What

The half of #13489 that needs no new identity: the edge stops drawing on the hourly GitHub allowance it shares with the agents for lists that have not changed, keeps to the time GitHub gives when it is turned away, and says what happened on the screens it affects.

Twice on 2026-11-23 the agents used the account's hour up, and the edge's reads of pull requests and prompts failed until it turned.

Changes

Asked by tag. Each answer to a read is kept under its address with GitHub's etag and asked for again with if-none-match. GitHub answers "not modified" for a list that has not changed, and such a call does not count against the allowance. GitHub is still asked every time and decides whether the kept answer stands, so nothing shown is older than before. The answers live in the object's memory (bounded, least lately used dropped first).

GitHub's time is kept to. Turned away for calling too often, GitHub says when to ask again (retry-after, or x-ratelimit-reset with nothing left). Until then the edge asks nothing that draws on what ran out, where before it asked again every five minutes. Never for more than 65 minutes; "Try again now" lifts it.

Two allowances, kept apart. GitHub counts searches by the minute and everything else by the hour. Ranked issues are a search, so they are still read while the hour's allowance is spent, and a minute's searches running out does not stop the lists. retry-after is said of the caller and hushes both.

Said in the app. "GitHub's allowance for the hour is used up on this account, which the agents share; GitHub says it answers again at 12:40 PM, and it is not asked before then. Showing the last good copy, read 12 min ago." A short wait, or GitHub's "secondary rate limit", is said as being turned away for asking too often, not as the hour.

A gap found on the way. The screens drawn from the operations document (Pull requests, Ranked issues, Agents, Units) said nothing when their list could not be read: they showed the old copy as if it were current. Each now names its own list.

Health has github: { answers, unchanged, kept, quiet: { core, search } }, so the saving and any wait can be seen from outside.

Not in this PR

  • The edge still has no allowance of its own. When the agents use the hour up, it is turned away with them until the hour turns. That takes an identity of its own on the account, which is the owner's to make; pm-console edge: its own GitHub allowance, so the core does not stop when the fleet is busy #13489 stays open for it.
  • With the allowance used up and no machine, something the owner does is kept for a machine, as before. The edge doing what it holds once GitHub answers again touches the rule against doing anything twice, and is its own change.
  • Whether GitHub answers "not modified" to a tagged read while the allowance is at zero is not known and not relied on.

Checked

  • bun test: 378 pass, 15 files (364 before). tsc (the check pm-console: type-check the console before it is deployed #13498 added to the deploy): clean.
  • The edge tests' stand-in GitHub now tags every read and answers "not modified", so all 111 edge tests run against it.
  • Property tests: when to ask again stays between now and 65 minutes on for any headers; the kept answers match a plain list kept the same way over 18,000 generated steps.
  • Mutation check: 53 faults planted one at a time in the new code; all 53 are caught.
  • Real Worker runtime (wrangler dev and scripts/edge-smoke.ts, which the deploy runs before deploying): a list read again is asked by its tag and the 304 is the kept answer; turned away with a reset time, the Worker asks nothing counted by the hour until that second, then asks again. All checks pass.
  • Real Chrome, light and dark, both ways the app is served: the notices on Pull requests, Ranked issues and Now; axe-core over 22 screens, no violations.
  • biome format, prettier, bun run src/server.ts --check, both wrangler deploy --dry-run builds.

Not checked: against GitHub itself. The first deploy's health (github.unchanged) will show whether its "not modified" answers arrive as documented.

After review

Two findings, both real, fixed in bc251c1 with a third found on the way:

  • The notice gave the age of the last try, not of the copy shown. Documents now carry good (when what is shown was read) beside read.
  • An answer cut off part-way was kept under its tag. Only a whole answer is kept.
  • An action is left to a machine for five minutes when this side is turned away for calling too often, as before this PR, not until GitHub's time; only a section's read is left until then.

Design record: doc/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core/ (section "2026-11-23T18:10Z Update").

https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF


Generated by Claude Code

…r asking again

The edge reads pull requests, ranked issues and prompts from GitHub with
the fleet's token, so it draws on the same hourly allowance the agents
do. Twice on 2026-11-23 the agents used the hour up and the edge's
reads failed until it turned (#13489).

- Each answer to a read is kept under its address with GitHub's tag,
  and asked for again by that tag. GitHub answers "not modified" for a
  list that has not changed, and such a call does not count against
  the allowance. A screen left open asks for the same lists every
  minute or two: those calls now cost nothing unless something changed.
- Turned away for calling too often, GitHub says when to ask again
  (retry-after, or the turn of the hour when nothing is left). That
  time is now kept to: nothing is asked of GitHub until it has come,
  where before the edge asked again every five minutes. It is never
  kept to for more than a little over an hour, and the owner's "try
  again now" lifts it.
- Why a read failed now starts with that time, so the app can say when.
- Health says how many of GitHub's answers were "not modified", so the
  saving can be seen from outside.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
… screen why its list is old

Follows the commit before it on this branch (#13489).

- GitHub counts searches by the minute and everything else by the
  hour. The time it gives for asking again is now kept to for what
  draws on the allowance that ran out, not for everything: ranked
  issues (a search) are still read while the hour's allowance is
  spent, and a minute's searches running out does not stop the lists.
  Going too fast (retry-after) is said of the caller and hushes both.
- A call held back is marked as not sent, and why it failed carries
  GitHub's own words, so the app can say which of the two it was.
- The app: "GitHub says it answers again at 12:40 PM, and it is not
  asked before then", and how old the copy shown is.
- The screens drawn from the operations document (pull requests,
  ranked issues, agents, units) said nothing when their list could not
  be read: they showed the old copy as if it were current. Each now
  names its own list and is told of that one.
- The real-runtime smoke run has GitHub's stand-in tag its answers and
  turn calls away with a time, and checks both in the Worker runtime.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 43 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fe366570-471a-4ac2-85b3-c52edbcb8c47
Commits

Reviewing files that changed from the base of the PR and between a0840e2 and bc251c1.

Files selected for processing: 13

  • doc/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core/2026-11-23T06-50-00Z_architecture_pm_platform_cloudflare_core.md
  • planning/roadmaps/pm-stack.md
  • pm-stack/console/edge/README.md
  • pm-stack/console/edge/src/direct.ts
  • pm-stack/console/edge/src/edge.ts
  • pm-stack/console/public/app.js
  • pm-stack/console/scripts/edge-smoke.ts
  • pm-stack/console/src/docs.ts
  • pm-stack/console/src/ops.ts
  • pm-stack/console/test/app.test.ts
  • pm-stack/console/test/direct.test.ts
  • pm-stack/console/test/edge.test.ts
  • pm-stack/console/test/work.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 06914ce89d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread pm-stack/console/public/app.js Outdated
if (only && !only.includes(name)) continue;
if (s.ok || !s.error) continue;
const what = name === "services" ? "the machine's units" : SECTION_SAID[name] || name;
const read = doc.read?.[name] ? `, read ${ago(doc.read[name], now)}` : "";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the last successful read time for the stale-copy age

When a refresh fails, this reports the age of the failed attempt rather than the last good copy. Docs.refresh() updates the section's at even on failure while preserving goodAt, and Docs.doc() populates doc.read from at. Consequently, an hours-old list can be described as “read just now,” with its displayed age resetting on subsequent failed refreshes. Expose and use the last-successful-read timestamp for this notice so users can assess how stale the displayed data actually is.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. A document's read time is when a list was last tried, and a failed try moves it on (Docs.refresh sets it in finally), so the notice would have said "just now" of a list hours old. Fixed in bc251c1: documents now also carry good, when what is shown of each list was read (goodAt), and the notice uses that. Tests: at the documents' level a failed try moves read and leaves good, twice over an hour; at the edge the copy's age is unchanged through forty minutes of being turned away; and a document from before this (one kept on a device) gives no age, with none made up from read.


Generated by Claude Code

Comment thread pm-stack/console/edge/src/direct.ts Outdated
}
if (!write && memory) {
const etag = res.headers?.get("etag") ?? null;
if (etag) memory.set(url, { etag, text });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid caching an unreadable response body

If a successful GET supplies an ETag but res.json() rejects—for example, when the connection closes while reading the body—the catch above converts the failure into empty text, which is then cached under the valid ETag. Subsequent requests receive 304 responses and reuse that empty text until the resource changes, the entry is evicted, or the object restarts. Ops.gh() converts empty stdout to null, so consumers such as Ops.prs() repeatedly fail at list.map instead of recovering on the next refresh as they did before. Only cache the response's ETag after its body has been successfully consumed and decoded.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right. A body that could not be read to its end became an empty answer and was then kept under GitHub's tag, so each later "not modified" would have brought the empty answer back. Fixed in bc251c1: an answer is kept only if its body arrived whole; one that did not is an empty answer that once, as before this PR, and whatever was kept under the address is let go, so the next read carries no tag and gets the list. Test: a list changes, the connection drops while it is read, the next read is a full one and is what is kept after. The fault planted back (keeping it anyway) fails that test.


Generated by Claude Code

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T18:11:10.242955Z 06914ce PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

# Conflicts:
#	pm-stack/console/scripts/edge-smoke.ts
…ction left five minutes

Review of #13570.

- The notice said how old the last try was, not the copy shown: a
  document's `read` time moves on with a failed try. Documents now
  also say when what is shown of each list was read (`good`), and the
  notice uses that.
- An answer whose body could not be read to its end was kept under
  GitHub's tag, and would have come back as the answer with every "not
  modified" after. Only an answer that arrived whole is kept.
- An action is left to a machine for five minutes when this side was
  turned away for calling too often, as it always was, and not until
  GitHub's time: what failed beside a call held back may have failed
  for a reason of its own. A section read from named services is still
  left until GitHub's time.
- The page's function takes the list of sections as the type checker
  reads it (the check added by #13498 caught the test passing one).
- The smoke run's wait is eight seconds and counts only what draws on
  the hour.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YLT5K1QVuzZjfWGFhXSSNF
@dezren39
dezren39 merged commit 5730675 into main Nov 23, 2026
2 checks passed
@dezren39
dezren39 deleted the claude/pm-etags branch November 23, 2026 22:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants